package com.atguigu.java14;

public class TestNull {
    public static void main(String[] args) {
        //Exception in thread "main" java.lang.NullPointerException: Cannot read field "machine" because "engine" is null
        new Car().engine.machine.start();
    }
}

class Car {
    public Engine engine;
}

class Engine {
    public Machine machine;
}

class Machine {
    public void start() {
        System.out.println("start");
    }

}